package edu.pku.sei.act.ctrl.editpart;

import java.beans.PropertyChangeEvent;

import org.eclipse.draw2d.IFigure;

import edu.pku.sei.act.ctrl.figure.DecisionNodeFigure;
import edu.pku.sei.act.images.ArchiModelImageProvider;
import edu.pku.sei.act.model.mote.DecisionNode;
import edu.pku.sei.gmp.controller.editpart.GMPNodeEditPart;

public class DecisionNodeEditPart extends GMPNodeEditPart{
	
	protected IFigure createFigure() {
		return new DecisionNodeFigure("DecisionNode",ArchiModelImageProvider.DECISIONNODELAEGE);
	}

	private DecisionNode getDecisionNode() {
		return (DecisionNode) getModelElement();
	}

	public void handlePropertyChanged(PropertyChangeEvent event) {
		refreshVisuals();
		super.handlePropertyChanged(event);
	}

	protected void refreshVisuals() {
		((DecisionNodeFigure)figure).setName("DecisionNode");
		super.refreshVisuals();
	}

}
